import request from '@/plugin/axios'

export function fetchList (data) {
  return request({
    url: '/microprogram/selectPersonnelRalationList',
    method: 'get',
    params: data
  })
}

export function getPersonnelByParentId (data) {
  return request({
    url: '/microprogram/getPersonnelByParentId',
    method: 'get',
    params: data
  })
}

export function getDistributionRuleList (data) {
  return request({
    url: '/microprogram/getShopDistributionList',
    method: 'get',
    params: data
  })
}

export function createOrEditDistributionRule (data) {
  return request({
    url: '/microprogram/shopDistribution',
    method: 'post',
    data: data
  })
}

export function deleteDistributionRule (data) {
  return request({
    url: '/microprogram/deleteShopDistribution/' + data,
    method: 'delete'
  })
}

export function setDistributionRule2Ywy (data) {
  return request({
    url: '/microprogram/setDistributionIdToUser',
    method: 'post',
    data: data
  })
}

export function fetchList4Statement (data) {
  return request({
    url: '/microprogram/getRelationCommissionList',
    method: 'get',
    params: data
  })
}

export function distributionDetail (data) {
  return request({
    url: '/microprogram/getRelationCommissionByUserId',
    method: 'get',
    params: data
  })
}

export function settleCommissionByIds (data) {
  return request({
    url: '/microprogram/settleCommissionByIds',
    method: 'post',
    data
  })
}